from tkinter import *


root=Tk()
#tickinterval指刻度，resolution指的是滑动的刻度，length指的是长度（像素）
s1=Scale(root,from_=0,to=50,tickinterval=5,resolution=5,length=200)
s2=Scale(root,from_=0,to=200,orient=HORIZONTAL,tickinterval=10,length=600)
s1.pack(side=RIGHT,fill=Y)
s2.pack(side=BOTTOM,fill=Y)

def show():
    print("水平：%d"%s2.get())
    print("垂直：%d"%s1.get())

theButton=Button(root,text="获取位置",command=show)
theButton.pack()

mainloop()